<template>
	<div class="carousel-wrapper">
		<!-- Swiper -->

		<div
			style="--swiper-navigation-color: #fff; --swiper-pagination-color: #fff"
			class="swiper mySwiper2"
		>
			<div class="swiper-wrapper">
				<div class="swiper-slide">
					<img src="../../static/images/carousel-b-1.png" />
				</div>
				<div class="swiper-slide">
					<img src="../../static/images/carousel-b-2.png" />
				</div>
				<div class="swiper-slide">
					<img src="../../static/images/carousel-b-3.png" />
				</div>
				<div class="swiper-slide">
					<img src="../../static/images/carousel-b-4.png" />
				</div>
			</div>
			<div class="swiper-button-next"></div>
			<div class="swiper-button-prev"></div>
		</div>
		<div thumbsSlider="" class="swiper mySwiper">
			<div class="swiper-wrapper">
				<div class="swiper-slide">
					<img src="../../static/images/carousel-s-1.png" />
				</div>
				<div class="swiper-slide">
					<img src="../../static/images/carousel-s-2.png" />
				</div>
				<div class="swiper-slide">
					<img src="../../static/images/carousel-s-3.png" />
				</div>
				<div class="swiper-slide">
					<img src="../../static/images/carousel-s-4.png" />
				</div>
			</div>
		</div>
	</div>
</template>

<script>
import Swiper from "swiper";
import "swiper/css/swiper.css";
export default {
	name: "carouselComp",
	mounted() {
		const swiper = new Swiper(".mySwiper", {
			loop: true,
			autoplay: true,
			spaceBetween: 10,
			slidesPerView: 4,
			freeMode: true,
			watchSlidesProgress: true,
		});
		new Swiper(".mySwiper2", {
			loop: true,
			autoplay: true,
			spaceBetween: 10,
			navigation: {
				nextEl: ".swiper-button-next",
				prevEl: ".swiper-button-prev",
			},
			thumbs: {
				swiper: swiper,
			},
		});
	},
};
</script>

<style scoped>
.carousel-wrapper {
	position: relative;
	width: 1160px;
	height: 332px;
	margin: 0 auto 40px;
	overflow: hidden;
}


.swiper-slide {
	text-align: center;
	font-size: 18px;
	background: #fff;

	/* Center slide text vertically */
	display: -webkit-box;
	display: -ms-flexbox;
	display: -webkit-flex;
	display: flex;
	-webkit-box-pack: center;
	-ms-flex-pack: center;
	-webkit-justify-content: center;
	justify-content: center;
	-webkit-box-align: center;
	-ms-flex-align: center;
	-webkit-align-items: center;
	align-items: center;
}

.swiper-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.swiper {
	position: absolute;
	width: 200px;
	height: 100px;
	overflow: hidden;
}

.swiper-slide {
	background-size: cover;
	background-position: center;
}

.mySwiper2 {
	height: 100%;
	width: 100%;
}

.mySwiper {
	position: absolute;
	right: 10px;
	bottom: 5px;
	width: 25%;
	height: 20%;
	border-radius: 4px;
	box-sizing: border-box;
	padding: 10px 0;
}

.mySwiper .swiper-slide {
	width: 100px;
	height: 100%;
	opacity: 1;
}

.mySwiper .swiper-slide-thumb-active {
	opacity: 1;
}

.swiper-slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
</style>
